<template>
    <div class="teach-title">
        <router-link v-for="(list, index) in navList" :key="index" :to="list.path" class="btn"
            @click.native="changeBtn(index)">
            {{list.title}}
        </router-link>
    </div>
</template>

<script>
    export default {
        name: 'secondNav',
        props: {
            navList: {
                type: Array,
            }
        },
        data() {
            return {
                n: 0
            }
        },
        methods: {
            changeBtn(i) {
                this.n = i;
            }
        }
    }
</script>

<style scoped lang="scss">
    .btn.router-link-active{
        color: #fff;
        background-color: #00aaff;
     }
    .teach-title {
        position: relative;
        height: 40px;
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .btn {
        float: left;
        margin-right: 20px;
        display: block;
        width: 120px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        border: 1px solid #ccc;
        background-color: #fff;
        border-radius: 5px;
        cursor: pointer;
    }
    a{
        color: #000;
        
        &:active{
            color: #ccc;
        }
    }
    
</style>
